<?php
$url = $_SERVER['PHP_SELF'];
$login = "";
$mycart = "";
$checkout = "";
$myaccount = "";
$shop = ""; $forum = ""; $about = ""; $contact = "";
$cars = "";
$index = "";
$signup=""; 
$tradein = "";
$ex = array();
$ex = explode("/",$url);
$n = count($ex)-1;

if($ex[$n] == "index.php"){
$index = 'class="selected"';

}
else if ($ex[$n] == "shop.php"){
$shop = 'class="selected"';

}
else if ($ex[$n] == "about.php"){
$about = 'class="selected"';

}
else if ($ex[$n] == "forum.php"){
$forum = 'class="selected"';

}
else if ($ex[$n] == "checkout.php"){
$checkout = 'class="selected"';

}
else if ($ex[$n] == "contact.php"){
$contact = 'class="selected"';

}
else if ($ex[$n] == "profile.php"){
$profile = 'class="selected"';

}
else if ($ex[$n] == "mycart.php"){
$mycart = 'class="selected"';

}
else if ($ex[$n] == "cars.php"){
$cars = 'class="selected"';

}
else if ($ex[$n] == "mylogin.php"){
$mylogin = 'class="selected"';

}
else if ($ex[$n] == "signup.php"){
$signup = 'class="selected"';
}
else if ($ex[$n] == "tradein.php"){
$tradein = 'class="selected"';
}
else if ($ex[$n] == "howtoorder.php"){
$tradein = 'class="selected"';
}

?>
		<script type="text/javascript" language="javascript" src="js/jquery.carouFredSel-6.2.0-packed.js"></script>

		<!-- optionally include helper plugins -->
		<script type="text/javascript" language="javascript" src="js/helper-plugins/jquery.transit.min.js"></script>
		<script type="text/javascript" language="javascript" src="js/helper-plugins/jquery.ba-throttle-debounce.min.js"></script>


<script>
jQuery(document).ready(function($){
	$('#keyword').autocomplete({source:"searchItem.php", minLength:1});
	
	$("#keyword").keypress(function (e){
		var value = $("#keyword");
		
		if(e.which == 13){
			window.location.href = "search.php?value="+value.val();
		}
		
	});
	
	
});
</script>

<!-- Let's do the animation -->
<script type="text/javascript">
	$(function() {
		// set opacity to nill on page load
		$("ul#menu span").css("opacity","0");
		// on mouse over
		$("ul#menu span").hover(function () {
			// animate opacity to full
			$(this).stop().animate({
				opacity: 1
			}, "slow");
		},
		// on mouse out
		function () {
			// animate opacity to nill
			$(this).stop().animate({
				opacity: 0
			}, "slow");
		});
	});
	
	
	
			$(function() {

				//	Scrolled by user interaction
				$('#foo2').carouFredSel({
					auto: false,
					prev: '#prev2',
					next: '#next2',
					mousewheel: true,
					swipe: {
						onMouse: true,
						onTouch: true
					}
				});


			

			});
</script>

<style>
#keyword{
position:relative;
z-index:50;
}

.list_carousel {
	width: 420px;
	float: right;
	margin-left: 10px;
	margin-right: 100px;
	margin-top: 20px;
}
.list_carousel ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: block;
}
.list_carousel li {
	text-align: center;
	width: 80px;
	height: 80px;
	padding: 5px;
	margin: 6px;
	display: block;
	float: left;
}
.list_carousel.responsive {
	width: auto;
	margin-left: 0;
}
.clearfix {
	float: none;
	clear: both;
}
a.prev, a.next {
background: url(images/download.png) no-repeat transparent;
width: 14px;
height: 21px;
display: block;
position: absolute;
top: 62px;
}

a.prev {            
left: 620px;
background: url(images/prev-dis.png);
opacity:.1;
}

a.prev:hover {      
background: url(images/prev.png);
opacity: .7;
}

a.next {            
right: 278px;
background: url(images/next-dis.png);
opacity:.1;
}

a.next:hover {      
background: url(images/next.png);
opacity:.7;
}


a.prev.disabled, a.next.disabled {
    cursor: default;

}

a.prev span, a.next span {
    display: none;
}


.timer {
	height: 6px;
	width: 0px;
}
</style>

<div id="msgbox2"></div>
<div id="templatemo_header">
    
    	<div id="site_title" style="padding-bottom:3px;">
        	<h1><a href="index.php"></a></h1>
        </div>
		
		<div class="list_carousel">
				<ul id="foo2">
					<li><a href="cars.php?brand=BMW"><img src="images/bmw.png" title="BMW" width="80" height="80" /></a></li>
					<li><a href="#"><img src="images/chev.png" title="Chevrolet" width="80" height="80" /></a></li>
					<li><a href="#"><img src="images/ford.png" title="Ford" width="80" height="80" /></a></li>
					<li><a href="#"><img src="images/honda-logo.png" title="Honda" width="80" height="80" /></a></li>
					<li><a href="#"><img src="images/hyundai-logo.png" title="Hyundai" width="80" height="80" /></a></li>
					<li><a href="#"><img src="images/mitsubishi.png" title="Mitsubishi" width="80" height="80" /></a></li>
					<li><a href="#"><img src="images/nissan.png" title="Nissan" width="80" height="80" /></a></li>
					<li><a href="#"><img src="images/toyota.png" title="Toyota" width="80" height="80" /></a></li>

				</ul>
				<div class="clearfix"></div>
				<a id="prev2" class="prev" href="#"><span>prev</span></a>
				<a id="next2" class="next" href="#"><span>next</span></a>
		</div>
        
		<?php 
			include("include/div_login_logout.php");
		?>
        
        
        <div class="cleaner"></div>
    </div> <!-- END of templatemo_header -->
    
    <div id="templatemo_menu">
		
    	<div id="top_nav" class="ddsmoothmenu">
            <ul id="menu">
                <li><a href="#" class="cars"><span></span></a>
					<ul>
                      <li><a href="cars.php" <?php echo $cars; ?> >Brand New</a></li>
                      <li><a href="tradein.php" <?php echo $tradein;?>>Used Cars</a></li>
                   </ul>
				</li>
                <li><a href="shop.php" class="shop" <?php echo $shop;?>><span></span></a></li>
				
				<li><a href="checkout.php" class="checkout" <?php echo $checkout;?> ><span></span></a></li> 
               <li><a href="howtoorder.php" class="howto" ><span></span></a></li>
				<li><a href="about.php " class="about" <?php echo $about;?>><span></span></a></li>
                <li><a href="forum.php" class="forum" <?php echo $forum;?>><span></span></a></li>
				<li><a href="contact.php" class="contact" <?php echo $contact; ?>><span></span></a></li>
				<div id="templatemo_search">
					
					  <input type="text" value="Search"  name="keyword" title="keyword" id="keyword"  onfocus="clearText(this)" onblur="clearText(this)" class="txt_field" />
					  <!--input type="submit" value=" Search "  name="Search"  alt="Search" id="searchbutton" title="Search" class="sub_btn"  /-->
					
				</div>
            </ul>
        </div> <!-- end of ddsmoothmenu -->
		
        <div id="menu_second_bar">
        
        	
            <div class="cleaner"></div>
    	</div>
    </div> <!-- END of templatemo_menu -->
